package com.llc.gulimall.ware.web;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author llc
 * @Description
 * @Version
 * @date 2022/2/17 17:52
 */
@Controller
public class TestRabbit {
    @Autowired
    RabbitTemplate rabbitTemplate;
    @GetMapping("/text/rabbit")
    @ResponseBody
    public String textRabbit(){
        rabbitTemplate.convertAndSend("stock-event-exchange","stock.locked","消息");
        return "ok";
    }
}
